package admin_api

import (
	"gitee.com/theegg/go-brick/app/model/admin/admin_users"
	"gitee.com/theegg/go-brick/app/service/app"
	"github.com/gin-gonic/gin"
)

// @title GetLoginAdminUser
// @description 获取当前登陆用户
func GetLoginAdminUser(c *gin.Context) (*admin_users.AdminUsers, error) {
	user, ok := c.Get("c_admin_user")
	if !ok {
		return nil, app.NewError("对不起, 用户未登陆")
	}
	return user.(*admin_users.AdminUsers), nil
}
